<?php

// top merch has picture name in it.
// base path is MERCH_ART_ROOT

$divTrain = "";
$localeMerchModel = new LocaleTopMerchandise();
$results = $localeMerchModel->getTopMerchandiseForLocale( $this->locale_id );
$localeFeaturedItems = $results['rows'];
$path = MERCH_ART_ROOT;

	$paper_stock_category = $this->caseInfo['paper_stock_category'];
	$verse = $this->caseInfo['verse'];
	$paper_stock_option = "$paper_stock_category / $verse";
	
/*
1. add an <A> around each image
2. HREF = javascript:addPicturedItemToCart( $price list id )
 */
 
foreach( $localeFeaturedItems as $item )
{
	$divTrain .= "<div class=\"topMerchItem center largecont\">";
	$itemId = $item['price_list_id'];
	$divTrain .= "<a href=\"javascript:addPicturedItemToCart( $itemId )\" style=\"text-decoration:none;\">";
	$divTrain .= "<img src=\"{$path}/{$item['picture']}\" border=\"0\">";	
	$divTrain .= "<br clear=both>{$item['item_name']}";
	$divTrain .= "<a>";
	$divTrain .= "</div>";
}

?>
<br>
<div class="standard center"><?php echo $divTrain?></div>
<br clear="all">
<div class="standard left large">
<br><br> 
<div  class="tundra">
    <h1>Full Merchandise List:</h1>
    <input type=text name="_filtertext" id="filtertext">&nbsp;
    <button type=button onclick='filterCatalogItems();'>Filter</button>&nbsp;
    <button type=button onclick='resetCatalogItemsFilter();'>Reset</button>&nbsp;<br>
    <div class="gridContainer">
	    <div id="dCatalogGrid">
	    </div>
    </div>
    <div id="gridButtons">
    <button id="btnAdd" type=button dojoType="dijit.form.Button" onClick='addSelectedItemToCart' style='font-size:9pt'>Add To Cart</button>
    </div>
</div>
<br>
<div class="tundra">
    <h1>Your Purchases:</h1>
    <div class="gridContainer">
	    <div id="dCartGrid">
	    </div>
    </div>
 <!--   <br clear="all"> -->
    <div id="gridButtons">
    <button id="btnRmv" type=button dojoType="dijit.form.Button" onClick='removeSelectedItemFromCart' style='font-size:9pt'>Remove From Cart</button>
    </div>
    <div>
<label for="paper_stock">Paper Stock:</label><br>
<select name="paper_stock" size=1>
<?php
foreach( PaperStock::$_options as $option )
{
	echo "<option";
	if($option == $paper_stock_option)
		echo " selected>$option</option>";
	else
		echo ">$option</option>";
}
 ?>
 </select>
	</div>
    
</div>
</div>
